package com.desehou.fristspring.service.impl;

import com.desehou.fristspring.dao.UserMapper;
import com.desehou.fristspring.model.User;
import com.desehou.fristspring.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service("userServiceImpl")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User selectById(Integer userId) {
        return userMapper.selectById(userId);
    }

    @Override
    public User selectByMobeleAndPsw(String mobile, String password) {
        return userMapper.selectByMobeleAndPsw(mobile, password);
    }

    @Override
    public ArrayList<User> users() {
        return userMapper.users();
    }

    @Override
    public Boolean editNickNameById(Integer userId, String nickName) {
        return userMapper.editNickNameById(userId, nickName);
    }

    @Override
    public Boolean register(String mobile, String password, String realName, String nickName, String userName,String token) {
        return userMapper.register(mobile,password,realName,nickName,userName,token);
    }
}
